 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>买8商城</title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
</head>
<script>
   function rem(){
            var html = document.getElementsByTagName('html')[0];
            console.log(html);
            /*取到屏幕的宽度*/
            var width = window.innerWidth;
            console.log(width);
            /* 640 100  320 50 */
            var fontSize = 100/750 * width;
            console.log(fontSize);
            /*设置fontsize*/
            html.style.fontSize = fontSize +'px';

        }
        rem();
</script>
<body>
    <div id="app">

    </div>    
</body>
</html>